<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input type="text" id="inputId"/><br>
    <input type="button" value="点我" onclick="clickMe()"/>

    <script>
        function clickMe() {
            var array = document.getElementsByTagName('input');
            console.log(array);
            console.log(array[0].value);

            var inputObj = document.getElementsByTagName('input')[0];
            var value = document.getElementsByTagName('input')[0].value;
        }
    </script>

    <!--
    <input type="text" id="inputId"/><br>
    <button onclick="clickMe()">点我</button>

    <script>
        function clickMe() {
            console.log('clickMe');
            var inputObj = document.getElementById('inputId');
            console.log(inputObj.value);
        }
    </script>-->
</body>
</html>